{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "%matplotlib inline"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 全局配置plot参数\n",
    "plt.rcParams['font.sans-serif'] = 'SimHei'\n",
    "plt.rcParams['axes.unicode_minus'] = False\n",
    "plt.rcParams['figure.figsize'] = (12.0, 12.0)\n",
    "plt.rcParams['text.usetex'] = True\n",
    "plt.rcParams['text.latex.preamble'] = [r'\\usepackage{amsmath}']\n",
    "plt.rcParams['animation.html'] = 'jshtml'\n",
    "plt.rcParams['axes.labelsize'] = 16"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "为了更好理解, 这里举一个例子: 向湖水里扔石头, 每扔一次湖水就会激起水波, 假设这个水波慢慢\n",
    "振幅减小且3秒后变为0.如果我每3秒中扔一个石头, 看到现象就是水波周期性(波的高度慢慢变小)振动,\n",
    "如果1秒中扔一个石头, 看到的现象是(线性)叠加后的效果."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "卷积公式: $y(t)=\\int_{-\\infty}^{+\\infty}{h(t-\\lambda)\\cdot f(\\lambda)\\cdot d\\lambda}$"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "ts = np.linspace(-1, 9, 50)\n",
    "\n",
    "def f_impulse(lam):\n",
    "    if (lam < 0):\n",
    "        return 0 \n",
    "    return 1\n",
    "\n",
    "def h_response(lam):\n",
    "    if (lam < 0 or lam > 3):\n",
    "        return 0\n",
    "    return round(-1*lam/3+1, 3)\n",
    "\n",
    "def line_sum(fs, hses):\n",
    "    return sum(fs * hses)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "fs = np.array([f_impulse(i) for i in ts])\n",
    "hs = np.array([h_response(i) for i in ts])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Text(-30, -50, '$h(\\\\lambda)$')"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAtcAAAEMCAYAAAAPn5osAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvOIA7rQAAIABJREFUeJzt3XtwXGeZ5/HfEzs4CcZpyysHyJKQFnEMld0lHWuHVHaoGFoZKqlxVYIkFwNFwhZuZ0LVLlUBC2oru/zBJXZMapaCDJKm2ECFiyXBkh0mmYya2IS1KWJZyVK5EXAPpAjgSaS0Mw7Oxfazf/SRrUvr0tK59dH3U9Ul9enT53nfVuvRo7ff8x5zdwEAAABYurOSbgAAAACQFRTXAAAAQEgorgEAAICQUFwDAAAAIUltcW1mO5JuAwBgYcjZAFCTyuLazIqS2pNuBwBgfuRsADgjlcU1AAAA0IxSV1ybWcHdy0m3AwAwP3I2AEyVuuJaUkvSDQAALBg5GwAmWZl0AyZbyAiImZUklSTpnHPOufKiiy6KpW2SdOrUKZ11Vjz/j8QZK+vxsty3uONluW9xx3vmmWdecPfWWIJFhJydTKysx8ty3+KOl+W+xR2voZzt7qm5SeqcdDskqTDX/hs2bPA47d27N5Oxsh4vy32LO16W+xZ3PEkjnoK8u5QbOTuZWFmPl+W+xR0vy32LO14jOTtV00Lcfcjdh1T7mDGXdHsAALMjZwPATKkqrie4e5+7t7n7aNJtAQDMjZwNAGeksrgGAAAAmhHFNQAAABASimsAAAAgJBTXAAAAQEgorgEAAICQUFwD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uTOVuKPW+nPmenbp3r2cwyaX3Bl+Bdgqqm/oeUuh9iCIpxnJU9aS7kqGof6ZQkRRk3P+kXPB/l2fwTiTKYAzamiKfYqPZR2MToQEW1UZE41hqOY85lSdKX3L1qZqOSOhXh+8TdK2a2Z9IcwbjmzGcaOTtykeftLOdsKfa8neWcLcWYt5shZzdNcT3pY7C47ZE0cWnNvGL4eMUmXfEs+KWPMlZpIkGbWTHiP3xFSROJMifpYISxJhLmxB/5SEdcVPvlnvgFb1Ptv/colVVLXlLtfRnpaylJwR+9yEdAJnP3ctQj10GC3uTufWa2PerfueWCnB1pvLjydpZzthRv3l4WOVuKPm83Q87OzDrXQXLrl7Re3JVeAAABdklEQVQt7Bc6+EWvqDZJP5ULli9G8BHYoGr/TbeodmJHZH+Igo+NuoN4He4e1xy+WATvk3HV3idxfBIQd7y8pJ44fm7BnMSKame8R/47N+kj2gprFceDnL04cebtrOdsKd48muWcHcSLLW+nPWdnprgGAAAAksYJjQAAAEBIKK4BAACAkFBcAwAAACGhuAYAAABCQnENAAAAhITiGgAAAAgJxTUAAAAQEoprYBoz6zSz4aTbAQCYHzkbaUNxDQAAAISEKzQCk5jZoKSipJykqqRxd29LtlUAgHrI2UgjimtgGjMrSepy946k2wIAmBs5G2nDtBAAAAAgJBTXAAAAQEgorgEAAICQUFwDM41LykuSmRUSbgsAYG7kbKQKxTUwU1mSzOxFSTvNLJdwewAAsyNnI1VYLQQAAAAICSPXAAAAQEgorgEAAICQUFwDAAAAIaG4BgAAAEJCcQ0AAACEhOIaAAAACAnFNQAAABASimsAAAAgJP8fPBztOs653jMAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 864x288 with 2 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "fig, axes = plt.subplots(1, 2, figsize=(12, 4))\n",
    "axes[0].set_xlabel('t')\n",
    "axes[0].set_ylabel('f(t),h(t)')\n",
    "axes[0].set_xlim([-1, 10])\n",
    "axes[0].set_ylim([-1, 4])\n",
    "axes[0].set_xticks(np.linspace(-1, 9, 11, dtype=np.int))\n",
    "axes[0].set_yticks(np.linspace(-1, 4, 6, dtype=np.int))\n",
    "axes[0].grid(True)\n",
    "\n",
    "axes[1].set_xlabel('t')\n",
    "axes[1].set_ylabel(r'$\\sum$')\n",
    "axes[1].set_xlim([-1, 10])\n",
    "axes[1].set_ylim([-1, 4])\n",
    "axes[1].set_xticks(np.linspace(-1, 9, 11, dtype=np.int))\n",
    "axes[1].set_yticks(np.linspace(-1, 4, 6, dtype=np.int))\n",
    "axes[1].grid(True)\n",
    "\n",
    "mask = fs > 0\n",
    "axes[0].scatter(ts[mask], fs[mask], s=10)\n",
    "mask = hs > 0\n",
    "axes[0].scatter(ts[mask], hs[mask], s=10)\n",
    "\n",
    "axes[0].annotate(r'$f(\\lambda)$', xy = (8, 1), xycoords = 'data',\n",
    "             xytext = (30, 30), textcoords = 'offset points',\n",
    "             fontsize = 16, arrowprops = dict(arrowstyle = '->', connectionstyle = 'arc3, rad = .2'))\n",
    "\n",
    "axes[0].annotate(r'$h(\\lambda)$', xy = (1.5, 0.5), xycoords = 'data',\n",
    "             xytext = (-30, -50), textcoords = 'offset points',\n",
    "             fontsize = 16, arrowprops = dict(arrowstyle = '->', connectionstyle = 'arc3, rad = .2'))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 叠加效应"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "移动$h(\\lambda)$, 分别在第3,6秒, 投放相同大小的石头$f(\\lambda) = 1$, 石头大小为1, 从下图看并没有叠加效应"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAtcAAAEMCAYAAAAPn5osAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGx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fMhRxT8SOdrKQg46Yr/sDTQZ7NX06UpTlg4wp4io2KH4WVRwfyKo6KhLHWcBhzLrOS/t7MCs65MUk9CvD3xMzyzrntFXMEw5ozn2jk7MAFnreTnLOl0PN2knO2FGLeboec3TbFdcXHYGHbLql8ac20Qvh4xVVc8az0Rx9krGw5QTvnMgH/48tIKifKlKTdAcYqJ8zyP/lAR1xU/OMu/4EvV7H3HqScislLKv5eBnosJan0Ty/wEZBKZpYLeuS6lKAvNrNB51x/0H9zcwU5O9B4YeXtJOdsKdy8PSdythR83m6HnJ2Yda5LyW2bpPW+D3TpDz2v4iT9WC5Y3ozSR2DDKvamO1Q8sSOwf0Slj436SvG6zSysOXyhKP2eTKj4exLGJwFhx0tL2hTGz600JzGv4hnvgf/NVXxEm2et4nCQs5sTZt5Oes6Wws2jSc7ZpXih5e245+zEFNcAAABA1DihEQAAAPCE4hoAAADwhOIaAAAA8ITiGgAAAPCE4hoAAADwhOIaAAAA8ITiGgAAAPCE4hqYwjnX45wbjbodAIDayNmIG4prAAAAwBOu0AhUcM4NS8pISkkqSJows+XRtgoAUA05G3FEcQ1M4ZzLSuo1s+6o2wIAmB05G3HDtBAAAADAE4prAAAAwBOKawAAAMATimtguglJaUlyznVF3BYAwOzI2YgVimtgupwkOedekbTZOZeKuD0AgJmRsxErrBYCAAAAeMLINQAAAOAJxTUAAADgCcU1AAAA4AnFNQAAAOAJxTUAAADgCcU1AAAA4AnFNQAAAOAJxTUAAADgyf8H+syGihUEjUYAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 864x288 with 2 Axes>"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "hses = [np.array([h_response(i-j) for i in ts]) for j in (0, 3, 6)]\n",
    "scaes = []\n",
    "for hs in hses:\n",
    "    mask = hs > 0\n",
    "    scaes.append(axes[0].scatter(ts[mask], hs[mask], s=4, color='blue', alpha=0.5))\n",
    "    \n",
    "ys = line_sum(fs, hses)\n",
    "mask = ys > 0\n",
    "axes[1].scatter(ts[mask], ys[mask], s=4, color=\"red\")\n",
    "fig"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "在第0秒投放一个石头, 在未来第3秒和第6秒均不在有效应, 并且第1,2秒没有投放石头\n",
    "\n",
    "1.未来的第3秒y(3)\n",
    "\n",
    "t = 0投放的时候3秒后(未来第3秒)为0  \n",
    "t = 1没有投放, 未来第3秒为0  \n",
    "t = 2没有投放, 未来第3秒为0  \n",
    "\n",
    "所以 t = 3时投放的效应为f(3)h(0) = 1\n",
    " \n",
    "2.未来的第6秒y(6)\n",
    "\n",
    "同上"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 删除axes[1]图里的数据\n",
    "for item in axes[1].collections :\n",
    "    item.remove()\n",
    "del axes[1].collections[:]\n",
    "\n",
    "# 隐藏axes[0]里面散点图的数据\n",
    "for sca in scaes:\n",
    "    sca.set_visible(False)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "移动$h(\\lambda)$, 分别在第1,2,3,4,5秒, 投放相同大小的石头$f(\\lambda) = 1$, 石头大小为1, 从下图看当水波振幅下降过程中(1秒), 又扔了一块同等大小的石头, 前一个石头的效应还没有结束, 效果叠加."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAtcAAAEMCAYAAAAPn5osAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvOIA7rQAAIABJREFUeJzt3X+QnFW95/HPyQQDGJNhcgdUMFwnGtBld2WS7BZSt4q4Ha4LZUpwMimvllC10oNJ1ZZbYGKV6xW3/EESlrIoA86EVfSKmp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WpNA3EqbQe9qGo8M70VUMA0uWtt97S+vXrdeDAAT300EN6xzuachPZ1mjTr6JKOXmZme2odGczu17SYefczlANxATMnwUyq5odGvslLZa0zsxmnE/tnFus0luOhWhO3y4/zQSA8o4ePapPfOITWrBgge677z4tWLAg6SYlZY2knKS+qHCelZntcM7tdc49Iqk11tZhsrTMn2VzGcC7GUeunXPXSeo1s7+erbCWShc2mlmfmb1f0ud8NRIAyjl69KiuvPJKnXXWWerv72/mwloqXbTYXW1hPS7K7d3iYvSw0jJ/NuvLyTH9BgmYsbg2sx1m9o/1nNjMuutrEgDMzsyUz+fV3t6uH/zgB82w1N6MzKzNzH5a52PHzGyl7zahAWR9Obmsv3hAKnlbLYSLGQGEdMstt+iZZ57R9773PbW0tCTdHKAxZX1zmay/eJAo6FOo5uI6ugp96rGLJQ14aREATPDWW2/psccem3TswQcf1Le+9S3de++9OvPMMxNqGRCDrBdKoYv5rL94kLg4NoXqGbmetgNjNGePtxQBePfEE0/oi1/84smvn332WV177bUaHBzUe97zngRbBsSAQqmxNcPOlJhV1Ts0RleTm6TFzrmHp3y7Q9Koz4YBgCS9/PLLOvfccyVJhw4d0tq1a7Vt2zZdcsklCbcMiEFaVhFB4wi9UyRmVcv2570qrZ26SqX1ricalVTw1SgAGPfSSy/p3HPP1bFjx7R+/XqtXbtW11xzTdLNAuJBoQQ0vKqL6/Gr0J1z3TNtTAAAPo2PXH/5y1+Wc04333yzfvzjH+umm27S7t27tWTJtJlqAAAkpuY51yyxByCkl19+Wa+99pruuusufelLX9KaNWu0detWffe736WwBuKQxEWVWb+QE01l1k1knHNX13pS59yiMvOya3l8Z72PBZAt+/btU29vr1atWqWuri51d3dr7969uvTSS5NuGiLk7JiFLjyTuKiS9aiRIbNuIiPpcufcw8651bOdLCqqb5Y0LOmLs92/wjlykph2AkCS9PTTT+uVV17R2WefraefflobNmxgXesUIWcHELrwTGL1iayvR00x31RmnRYSbaW7Q9IO59zxqNC+wzn3TefcjdHHO5xzv5d0SNJi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TOZsKXjeTn3OTt0615VUmLRe9Ra8czCmya+QUvdD9CAX4qrsCXMhR1R6SycvKc64HRP+wDvivJp/PFFGc8AOKuYpNiq9FTY+OlBUaVQkxFrDIeZc5iV908zGnHMjkroU4++JmRWdczsnzBEMNWc+08jZsYs9b2c5Z0vB83aWc7YUMG83Qs5umOJ6wttgoe2UNL61ZocCvL3iJux4Fv3RxxkrP56gnXO5mP/x5SSNJ8pWSXtijDWeMMf/ycc64qLSH/f4H/gylV69x6mgUvKSSr+XsT6XkhT904t9BGQiMyvEPXIdJeiVZtbnnOuJ+2+uWZCzY40XKm9nOWdLYfN2U+RsKf683Qg5OzPrXEfJbYek63w/0dEfelGlSfqpXLC8HtFbYAMqvZpuU+nCjtj+EUVvG3VH8daYWag5fEFEvyejKv2ehHgnIHS8DkmbQ/zcojmJRZWueI/9b27CW7RF1ioOg5xdn5B5O+s5WwqbR7Ocs6N4wfJ22nN2ZoprAAAAIGlc0AgAAAB4QnENAAAAeEJxDQAAAHhCcQ0AAAB4QnENAAAAeEJxDQAAAHhCcQ0AAAB4QnENTOGc63LODSXdDgDA7MjZSBuKawAAAMATdmgEJnDODUjKSWqVNCZp1MyWJdsqAEA55GykEcU1MIVzLi9pnZmtSbotAICZkbORNkwLAQAAADyhuAYAAAA8obgGAAAAPKG4BqYbldQhSc65zoTbAgCYGTkbqUJxDUxXkCTn3CFJW5xzrQm3BwBQGTkbqcJqIQAAAIAnjFwDAAAAnlBcAwAAAJ5QXAMAAACeUFwDAAAAnlBcAwAAAJ5QXAMAAACeUFwDAAAAnlBcAwAAAJ78f39G73rZfVObAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 864x288 with 2 Axes>"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "hses = [np.array([h_response(i-j) for i in ts]) for j in range(0, 7)]\n",
    "for hs in hses:\n",
    "    mask = hs > 0\n",
    "    axes[0].scatter(ts[mask], hs[mask], s=4, color='green')\n",
    "    \n",
    "ys = line_sum(fs, hses)\n",
    "mask = ys > 0\n",
    "axes[1].scatter(ts[mask], ys[mask], s=4, color=\"red\")\n",
    "fig"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "如果扔石头的更频繁, 从下图可以看出, 最终的y(t)效果趋于稳定在一个值上."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "分析未来第4秒的情况(其他类似):\n",
    "    \n",
    "t=0点对未来第4秒: f(0)*h(4-0) = f(0)*h(4) = 0   \n",
    "t=1点对未来第4秒: f(1)*h(4-1) = f(2)*h(3) = 0  \n",
    "t=2点对未来第4秒: f(2)*h(4-2) = f(2)*h(2) = 1/3  \n",
    "t=3点对未来第4秒: f(3)*h(4-3) = f(3)*h(1) = 2/3  \n",
    "t=4点对未来第4秒: f(4)*h(4-4) = f(4)*h(0) = 1 (就是当前)  \n",
    "\n",
    "所有总效应:\n",
    "\n",
    "\n",
    "$\n",
    "\\begin{align*}\n",
    "y(4) &= f(4)*h(4-4) + f(3)*h(4-3) + f(2)*h(4-2) + f(1)*h(4-1) + f(0)h(4-0) \\\\\n",
    "     &= 1 + 2/3 + 1/3 + 0 + 0 \\\\\n",
    "     &= 2\n",
    "\\end{align*}\n",
    "$\n",
    "\n",
    "\n",
    "**从上面的计算推导, 可以隐约看到180翻转的来由**.\n",
    "\n",
    "-----------------------------------------------------------------------"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.collections.PathCollection at 0x7f14bdad4b00>"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAtwAAAHlCAYAAADGNCuRAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuM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2owJYPoIb4Barqq0kT1prn8x6LADLypYSAADoSHADAEBHghsAADoS3AC325ska0lSVeszHgvAUhLcALfbiySpqt8neVpVd2c8HoCl4yolAADQkRVuAADoSHADAEBHghsAADoS3AAA0JHgBgCAjgQ3AAB0JLgBAKCj/w/eYlE5J+jDIwAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 864x576 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "fig, ax = plt.subplots(1, 1, figsize=(12, 8))\n",
    "ax.set_xlabel('t')\n",
    "ax.set_ylabel('y(t)')\n",
    "ax.grid(True)\n",
    "\n",
    "hses = [np.array([h_response(i-j) for i in ts]) for j in np.linspace(0, 8, 100)]\n",
    "ys = line_sum(fs, hses)\n",
    "mask = ys > 0\n",
    "ax.scatter(ts[mask], ys[mask], s=4, color=\"red\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 数学积分\n",
    "\n",
    "当扔石头非常非常密集的时候, 就需要积分计算"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "$f(\\lambda)$表示扔石头(刺激), $h(\\lambda)$表示水波振幅(响应)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "$\n",
    "f(\\lambda) = 1\n",
    "$\n",
    "\n",
    "\n",
    "$\n",
    "h(\\lambda) = \\left\\{\\begin{matrix}\n",
    "0 &, & \\lambda < 0\\\\ \n",
    "-\\dfrac{1}{3}\\lambda +1 &, & 0 \\leq \\lambda \\leq 3\\\\ \n",
    "0 &, & \\lambda > 3\n",
    "\\end{matrix}\\right.\n",
    "$\n",
    "\n",
    "-----------------------------------------------------\n",
    "\n",
    "$y(t)=\\int_{-\\infty}^{+\\infty}{h(t-\\lambda)\\cdot f(\\lambda)\\cdot d\\lambda}$"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "当t < 0:\n",
    "\n",
    "$y(t) = \\int\\limits_{-\\infty}^{0}f(\\lambda)h(t-\\lambda)d\\lambda = \\int\\limits_{-\\infty}^{0}0d\\lambda = 0$"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "当0 < t < 3:\n",
    "\n",
    "$ \\begin{align*}\n",
    "y(t) &= \\int\\limits_{0}^{t}f(\\lambda)h(t-\\lambda)d\\lambda \\\\ \n",
    " &= \\int\\limits_{0}^{t}\\left(1-\\dfrac{1}{3}(t-\\lambda)\\right)d\\lambda \\\\ \n",
    " &= \\left( {\\lambda - \\dfrac{1}{3}(t\\lambda - \\dfrac{\\lambda^2}{2}}\\right)\\bigg|_{0}^{t}\\\\\n",
    " &= t - \\dfrac{1}{6}t^2\n",
    "\\end{align*}\n",
    "$"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "当t > 3:\n",
    "\n",
    "$y(t) = \\int\\limits_{3}^{+\\infty}f(\\lambda)h(t-\\lambda)d\\lambda = \\int\\limits_{-\\infty}^{0}0d\\lambda = 0$"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "综上:\n",
    "\n",
    "$ \n",
    "\\begin{align*}\n",
    "y(t) &= \\int\\limits_{-\\infty}^{+\\infty}f(\\lambda)h(t-\\lambda)d\\lambda \\\\ \n",
    " &= \\int\\limits_{-\\infty}^{0}f(\\lambda)h(t-\\lambda)d\\lambda + \\int\\limits_{0}^{3}f(\\lambda)h(t-\\lambda)d\\lambda + \\int\\limits_{3}^{+\\infty}f(\\lambda)h(t-\\lambda)d\\lambda \\\\ \n",
    "\\end{align*}\n",
    "$"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "$\n",
    "y(t) = \\left\\{\\begin{matrix}\n",
    "0 &, & t < 0\\\\ \n",
    "t - \\dfrac{1}{6}t^2 &, & 0 \\leq t \\leq 3\\\\ \n",
    "3 - \\dfrac{1}{6}3^2 &, & t > 3\n",
    "\\end{matrix}\\right.\n",
    "$\n",
    "\n",
    "---------------------------------------------------"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 继续用离散数据和图形描述"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "$y(t) = \\sum\\limits_{i = 0}^\\infty {\\left( {f\\left( {i \\cdot \\Delta T} \\right) \\cdot \\Delta T} \\right)}\n",
    "          \\cdot h\\left( {t - i \\cdot \\Delta T} \\right)$"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "(未完, 待补充)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
